﻿using System;
using System.ComponentModel;
using System.Web.UI;

namespace MyLib.Web.UI {
	/// <summary>
	/// 
	/// </summary>
	[DefaultProperty("Digit")]
	[ToolboxData("<{0}:MyFormatValidator runat=\"server\"></{0}:MyFormatValidator>")]
	public sealed class MyFormatValidator : MyFormatBaseValidator {
		/// <summary>
		/// 
		/// </summary>
		[Category("Appearance")]
		[DefaultValue("")]
		public string FormatString {
			get {
				var obj = ViewState["FormatString"];
				if (obj == null) {
					return "";
				} else {
					return (string)obj;
				}
			}
			set {
				ViewState["FormatString"] = value;
			}
		}

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		protected override string GetExpression() {
			return FormatString.Trim();
		}
	} // end of MyEmailValidator.
}
